package com.avic.rong.listener;

import android.content.Context;
import android.view.View;

import com.avic.rong.utils.DateUtils;

import java.lang.ref.WeakReference;

/**
 * Creater: Created by wangyz on 2017/3/27.
 * Email: 936804097@qq.com
 */

public class CategoryItemOnClickListener implements View.OnClickListener {

    private WeakReference<Context> contextWeakReference;
    private int categoryId;

    public CategoryItemOnClickListener(Context context, int categoryId) {
        this.contextWeakReference = new WeakReference<>(context);
        this.categoryId = categoryId;
    }

    @Override
    public void onClick(View view) {
        if (DateUtils.isFastDoubleClick()) {
            return;
        }

//        if (categoryId == 0) {//标准列表
//            contextWeakReference.get().startActivity(CriterionListActivity.queryIntent(contextWeakReference.get(), AppUtils.BASE_URL + "/app/biaozhun/criterionList"));
//        } else if (categoryId == 1) {//专题库
//            contextWeakReference.get().startActivity(CriterionListActivity.queryIntent(contextWeakReference.get(), AppUtils.BASE_URL + "/app/biaozhun/topicLibrary"));
//        } else if (categoryId == 2) {//知识服务
//            contextWeakReference.get().startActivity(CriterionListActivity.queryIntent(contextWeakReference.get(), AppUtils.BASE_URL + "/app/biaozhun/knowserviceList"));
//        } else if (categoryId == 3) {//图书
//            contextWeakReference.get().startActivity(CriterionListActivity.queryIntent(contextWeakReference.get(), AppUtils.BASE_URL + "/app/biaozhun/bookList"));
//        }
    }
}

